home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / MDUSPM (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  1.6 KB  |  41 lines

  1. package com.sun.java.swing.plaf.metal;
  2.  
  3. import com.sun.java.swing.Icon;
  4. import com.sun.java.swing.plaf.UIResource;
  5. import java.awt.Component;
  6. import java.awt.Graphics;
  7. import java.io.Serializable;
  8.  
  9. class MetalIconFactory$TreeFloppyDriveIcon implements Icon, UIResource, Serializable {
  10.    public void paintIcon(Component c, Graphics g, int x, int y) {
  11.       g.translate(x, y);
  12.       g.setColor(MetalLookAndFeel.getPrimaryControl());
  13.       g.fillRect(2, 2, 12, 12);
  14.       g.setColor(MetalLookAndFeel.getPrimaryControlInfo());
  15.       g.drawLine(1, 1, 13, 1);
  16.       g.drawLine(14, 2, 14, 14);
  17.       g.drawLine(1, 14, 14, 14);
  18.       g.drawLine(1, 1, 1, 14);
  19.       g.setColor(MetalLookAndFeel.getControlDarkShadow());
  20.       g.fillRect(5, 2, 6, 5);
  21.       g.drawLine(4, 8, 11, 8);
  22.       g.drawLine(3, 9, 3, 13);
  23.       g.drawLine(12, 9, 12, 13);
  24.       g.setColor(MetalLookAndFeel.getPrimaryControlHighlight());
  25.       g.fillRect(8, 3, 2, 3);
  26.       g.fillRect(4, 9, 8, 5);
  27.       g.setColor(MetalLookAndFeel.getPrimaryControlShadow());
  28.       g.drawLine(5, 10, 9, 10);
  29.       g.drawLine(5, 12, 8, 12);
  30.       g.translate(-x, -y);
  31.    }
  32.  
  33.    public int getIconWidth() {
  34.       return 16;
  35.    }
  36.  
  37.    public int getIconHeight() {
  38.       return 16;
  39.    }
  40. }
  41.